Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable integration tests for the transaction fetcher #129

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

thpani
Copy link
Collaborator

@thpani thpani commented Sep 26, 2024

Our fetcher integration test so far relies on hard-coded transaction hashes that were pre-populated by the setter-popluate.sh script. Those tx hashes need to be manually updated whenever the testnet resets, or when the setter contract is updated.

This PR introduces programmatic population of the deployed setter contract to achieve a more stable integration test: On each integration test run, a fresh copy of the setter contract is created from its on-chain WASM code (there is a 1:n relationship between WASM code and contracts IDs). Each test then invokes a setter function of the contract, followed by fetching the respective transaction and verifying the call decoder output as before.

This could be further optimized for performance (i.e., only repopulate the contract when necessary), but for now a stable integration test is more important.

Closes #56

@thpani thpani requested a review from konnov September 26, 2024 13:21
Copy link
Contributor

@konnov konnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool! I did not know that one could deploy a contract from WASM saved on-chain :)

@thpani thpani merged commit db92909 into main Sep 26, 2024
3 checks passed
@thpani thpani deleted the th/stable-decoder-test branch September 26, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Develop more stable integration tests for the transaction fetcher
2 participants